package com.netease.pris.activity.view.WebViews;

import android.content.Context;
import android.os.Handler;
import android.text.ClipboardManager;
import android.util.AttributeSet;
import android.util.Log;
import android.view.MotionEvent;
import android.webkit.WebView;
import android.webkit.WebView.HitTestResult;
import com.netease.pris.activity.view.f;
import java.lang.reflect.Field;
import java.lang.reflect.Method;

public abstract class WebViewAdapter extends WebView
{
  protected f a = null;
  protected b b = null;
  private a c;
  private ClipboardManager d;
  private boolean e = false;
  private Handler f = new Handler();
  private Method g;
  private Method h;
  private Field i;
  private Field j;
  private Field k;
  private Method l;
  private Method m;
  private Field n;

  public WebViewAdapter(Context paramContext)
  {
    super(paramContext);
    a(paramContext);
  }

  public WebViewAdapter(Context paramContext, AttributeSet paramAttributeSet)
  {
    super(paramContext, paramAttributeSet);
    a(paramContext);
  }

  public WebViewAdapter(Context paramContext, AttributeSet paramAttributeSet, int paramInt)
  {
    super(paramContext, paramAttributeSet, paramInt);
    a(paramContext);
  }

  private void a(Context paramContext)
  {
    this.d = ((ClipboardManager)paramContext.getSystemService("clipboard"));
  }

  public abstract void a();

  public void a(float paramFloat1, float paramFloat2)
  {
    if (this.a != null)
    {
      int[] arrayOfInt = new int[2];
      getLocationInWindow(arrayOfInt);
      this.a.a(this, arrayOfInt[0] + (int)paramFloat1, arrayOfInt[1] + (int)paramFloat2, 0);
    }
  }

  protected void a(int paramInt1, int paramInt2, int paramInt3, int paramInt4)
  {
    try
    {
      if (this.l == null)
      {
        Class[] arrayOfClass = new Class[3];
        arrayOfClass[0] = Integer.TYPE;
        arrayOfClass[1] = Integer.TYPE;
        arrayOfClass[2] = Boolean.TYPE;
        this.l = WebView.class.getDeclaredMethod("nativeMoveSelection", arrayOfClass);
        this.l.setAccessible(true);
      }
      Object[] arrayOfObject1 = new Object[3];
      arrayOfObject1[0] = Integer.valueOf(paramInt1);
      arrayOfObject1[1] = Integer.valueOf(paramInt2);
      arrayOfObject1[2] = Boolean.valueOf(false);
      this.l.invoke(this, arrayOfObject1);
      a(true);
      Method localMethod = this.l;
      Object[] arrayOfObject2 = new Object[3];
      arrayOfObject2[0] = Integer.valueOf(paramInt3);
      arrayOfObject2[1] = Integer.valueOf(paramInt4);
      arrayOfObject2[2] = Boolean.valueOf(true);
      localMethod.invoke(this, arrayOfObject2);
      c(true);
      label152: return;
    }
    catch (Exception localException)
    {
      break label152;
    }
  }

  public void a(MotionEvent paramMotionEvent)
  {
    if (this.a != null)
    {
      int[] arrayOfInt = new int[2];
      getLocationInWindow(arrayOfInt);
      this.a.a(this, arrayOfInt[0] + (int)paramMotionEvent.getX(), arrayOfInt[1] + (int)paramMotionEvent.getY(), 0);
    }
  }

  public void a(a parama)
  {
    this.c = parama;
  }

  public void a(b paramb)
  {
    this.b = paramb;
  }

  public void a(Runnable paramRunnable)
  {
    if (c.a())
      this.f.postDelayed(paramRunnable, 300L);
    while (true)
    {
      return;
      paramRunnable.run();
    }
  }

  protected void a(boolean paramBoolean)
  {
    try
    {
      if (this.i == null)
      {
        this.i = WebView.class.getDeclaredField("mExtendSelection");
        this.i.setAccessible(true);
      }
      this.i.setBoolean(this, paramBoolean);
      label35: return;
    }
    catch (Exception localException)
    {
      break label35;
    }
  }

  protected void b(boolean paramBoolean)
  {
    try
    {
      if (this.j == null)
      {
        this.j = WebView.class.getDeclaredField("mShiftIsPressed");
        this.j.setAccessible(true);
      }
      this.j.setBoolean(this, paramBoolean);
      label35: return;
    }
    catch (Exception localException)
    {
      break label35;
    }
  }

  protected void c(boolean paramBoolean)
  {
    try
    {
      if (this.k == null)
      {
        this.k = WebView.class.getDeclaredField("mTouchSelection");
        this.k.setAccessible(true);
      }
      this.k.setBoolean(this, paramBoolean);
      label35: return;
    }
    catch (Exception localException)
    {
      break label35;
    }
  }

  public abstract void d();

  public void destroy()
  {
    super.destroy();
    if (!this.e)
      this.e = true;
  }

  public boolean e()
  {
    return false;
  }

  public void f()
  {
    if (this.a != null)
    {
      this.a.b();
      this.a = null;
    }
    if (this.a == null)
      this.a = new f(getContext());
    if (this.c != null)
    {
      this.a.a();
      this.c.a(this.a);
    }
    if (this.b != null)
      this.b.b(this);
  }

  public String g()
  {
    this.d = ((ClipboardManager)getContext().getSystemService("clipboard"));
    return this.d.getText().toString();
  }

  public boolean h()
  {
    try
    {
      if (this.g == null)
      {
        this.g = WebView.class.getDeclaredMethod("commitCopy", new Class[0]);
        this.g.setAccessible(true);
      }
      boolean bool2 = ((Boolean)this.g.invoke(this, new Object[0])).booleanValue();
      bool1 = bool2;
      return bool1;
    }
    catch (Exception localException)
    {
      while (true)
      {
        Log.e("WebviewCopy", "Could not copyText ", localException);
        boolean bool1 = false;
      }
    }
  }

  public boolean i()
  {
    try
    {
      if (this.g == null)
      {
        this.g = WebView.class.getDeclaredMethod("copySelection", new Class[0]);
        this.g.setAccessible(true);
      }
      boolean bool2 = ((Boolean)this.g.invoke(this, new Object[0])).booleanValue();
      bool1 = bool2;
      return bool1;
    }
    catch (Exception localException)
    {
      while (true)
        boolean bool1 = false;
    }
  }

  public boolean j()
  {
    try
    {
      if (this.h == null)
      {
        this.h = WebView.class.getDeclaredMethod("selectionDone", new Class[0]);
        this.h.setAccessible(true);
      }
      boolean bool2 = ((Boolean)this.h.invoke(this, new Object[0])).booleanValue();
      bool1 = bool2;
      return bool1;
    }
    catch (Exception localException)
    {
      while (true)
        boolean bool1 = false;
    }
  }

  public void k()
  {
    a(false);
    b(false);
    c(false);
    l();
    invalidate();
  }

  public void l()
  {
    if (this.a != null)
    {
      this.a.b();
      this.a = null;
    }
    if (this.b != null)
      this.b.a(this);
  }

  protected boolean m()
  {
    try
    {
      if (this.j == null)
      {
        this.j = WebView.class.getDeclaredField("mShiftIsPressed");
        this.j.setAccessible(true);
      }
      boolean bool2 = this.j.getBoolean(this);
      bool1 = bool2;
      return bool1;
    }
    catch (Exception localException)
    {
      while (true)
        boolean bool1 = false;
    }
  }

  public void n()
  {
    try
    {
      if (this.m == null)
      {
        this.m = WebView.class.getDeclaredMethod("selectText", new Class[0]);
        this.m.setAccessible(true);
      }
      this.m.invoke(this, new Object[0]);
      label43: return;
    }
    catch (Exception localException)
    {
      break label43;
    }
  }

  public boolean o()
  {
    try
    {
      if (this.n == null)
      {
        this.n = WebView.class.getDeclaredField("mSelectingText");
        this.n.setAccessible(true);
      }
      boolean bool2 = Boolean.valueOf(this.n.getBoolean(this)).booleanValue();
      bool1 = bool2;
      return bool1;
    }
    catch (SecurityException localSecurityException)
    {
      while (true)
      {
        localSecurityException.printStackTrace();
        boolean bool1 = false;
      }
    }
    catch (NoSuchFieldException localNoSuchFieldException)
    {
      while (true)
        localNoSuchFieldException.printStackTrace();
    }
    catch (IllegalArgumentException localIllegalArgumentException)
    {
      while (true)
        localIllegalArgumentException.printStackTrace();
    }
    catch (IllegalAccessException localIllegalAccessException)
    {
      while (true)
        localIllegalAccessException.printStackTrace();
    }
  }

  public boolean onTrackballEvent(MotionEvent paramMotionEvent)
  {
    if (e());
    for (boolean bool = true; ; bool = super.onTrackballEvent(paramMotionEvent))
      return bool;
  }

  public boolean p()
  {
    WebView.HitTestResult localHitTestResult = getHitTestResult();
    if ((localHitTestResult.getType() != 8) && (localHitTestResult.getType() != 5));
    for (int i1 = 1; ; i1 = 0)
      return i1;
  }

  public boolean q()
  {
    return this.e;
  }
}

/* Location:           D:\android\hack\dex2jar-0.0.9.8\classes_dex2jar.jar
 * Qualified Name:     com.netease.pris.activity.view.WebViews.WebViewAdapter
 * JD-Core Version:    0.6.0
 */